<template>
    <view class="container" v-if="fansList.length">
        <view class="title">我的粉丝({{ fansList.length }})</view>
        <view class="content">
            <FollowListItem v-for="(item, index) in fansList" :key="index" :item="item">
            </FollowListItem>
        </view>
    </view>
</template>
<script setup lang="ts">
import FollowListItem from '../components/FollowListItem.vue';
import { API_getFansList } from '@/service/follow';
import type { FollowItem } from '@/type/follow';
import { onLoad } from '@dcloudio/uni-app';
import { useUserStore } from '@/store';
import { ref } from 'vue';
const userStore = useUserStore();
const fansList = ref<FollowItem[]>([]);
const getFanList = async () => {
    let res = await API_getFansList(userStore.userInfo!.id!);
    return res.data;
}
onLoad(async () => {
    fansList.value = await getFanList();
})
</script>
<style scoped lang="scss">
.container {
    margin: 20rpx;

    .title {
        font-size: 30rpx;
        color: #aaa;
        margin-bottom: 20rpx;
    }
}
</style>
